<%--
  Created by IntelliJ IDEA.
  User: 东方九夜
  Date: 2021/6/16
  Time: 9:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    	pageEncoding="utf-8"%>
<%@ page import="bean.*" %>
<%@ page import="dao.*" %>
<!DOCTYPE HTML>
<html>
	<head>
		<meta charset="utf-8" />
		<title>修改信息界面</title>
		<link type="text/css" rel="stylesheet" href="css/index.css">
		<link type="text/css" rel="stylesheet" href="css/bootstrap.min.css">
	</head>
	<body>
		<%
			Customer c = (Customer) request.getSession().getAttribute("admin");
			//Teacher t = (Teacher)request.getSession().getAttribute("teacher");
			if(c == null){
				response.sendRedirect("Not_Login.jsp");
			}
		%>
		<div class="main">
			<div class="navigation">
				<span>欢迎回来! 
					<%
						if(c != null){
							out.print(c.getName());
						}
					%>
					管理员
				</span>
				<a class="exit" href="index.jsp"><span>退出登录</span></a>
			</div>
			<table class="table" style="margin:0 auto;width:90%">
				<tr>
					<td style="width:20%"><button class= "btn btn-info" style="width:100%" onclick="window.location.href='index_Admin.jsp'">公告</button>	</td>
					<td style="width:20%"><button class= "btn btn-info" style="width:100%" onclick="window.location.href='Manage_Students.jsp?pages=1'">学生管理</button></td>
					<td style="width:20%"><button class= "btn btn-info" style="width:100%" onclick="window.location.href='Manage_Teachers.jsp'">教师管理</button></td>
				</tr>
			</table>
			<div>
				<%
					String ID = request.getParameter("ID");
					Customer customer = AdminSql.getCustomerByID(ID);
				%>
				<form  method="post" action="AlterServlet">
					<table class="table table-hover; table_center" style="margin:0 auto;width:90%;color: white">
						<td>编号:<%=customer.getId() %></td>
						<td>
							<div class="form-group">
								<label >姓名</label>
								<input type="text" name="Name" value="<%=customer.getName()%>" style="color: black"/>
							</div>
						</td>
						<td>
							<div class="form-group">
								<label >密码</label>
								<input type="text" name="Password" value="<%=customer.getPassword()%>" style="color: black"/>
							</div>
						</td>
						<td>
							<div>
								<label>学院: </label>
								<select name="Depart" style="color: black">
									<option value="信息科学与技术学院" >信息科学与技术学院</option>
									<option value="艺术学院">艺术学院</option>
									<option value="新闻与传媒学院">新闻与传媒学院</option>
									<option value="机械学院">机械学院</option>
									<option value="马克思学院">马克思学院</option>
								</select>
							</div>
						</td>
						<td>
							<div>
								<label>性别: </label>
								<select name="Sex" style="color: black">
									<option value="男">男</option>
									<option value="女">女</option>
								</select>
							</div>
							<input type="hidden" name="ID" value="<%=ID %>" />
							<input type="hidden" name="Type" value="<%=customer.getType()%>" />
						</td>
						<td>
							<button type="submit" class="btn btn-default btn-sm" >提交</button>
						</td>
					</table>
				</form>
			</div>
			<div class="clear"></div>			
		</div>

	</body>
</html>
